
	
/****** Object:  Stored Procedure [dbo].tblOpicsTransactionInsert    Script Date: Thursday, October 27, 2011 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sptblOpicsTransactionInsert]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sptblOpicsTransactionInsert]
GO

	
	

/******************************************************************************
**		File: 
**		Name: [dbo].sptblOpicsTransactionInsert
**		Desc: 
**
**		Return values:
** 
**		Called by:   
**              
**		Parameters:
**		Input							Output
**     ----------							-----------
**
**		Auth: CodeSmith
**		Date: 27/10/2011 17:41:38
*******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:				Description:
**		--------		--------				-------------------------------------------
**    
*******************************************************************************/
CREATE PROCEDURE [dbo].sptblOpicsTransactionInsert
	@ValueDate datetime,
	@ValueDateInOpics datetime,
	@DealDate datetime,
	@BuyCurrency varchar(3),
	@SellCurrency varchar(3),
	@CustomerRate decimal(10, 2),
	@BuyAmount decimal(24, 6),
	@SellAmount decimal(24, 6),
	@InternalRate decimal(24, 6),
	@Customer varchar(20),
	@Porfolio varchar(20),
	@Branch varchar(2),
	@ImportTransactionID uniqueidentifier,
	@RunningDate datetime,
	@Status int,
	@DealNo varchar(10),
	@ID uniqueidentifier output
AS

SET @ID = NEWID()

INSERT INTO [dbo].[tblOpicsTransaction] 
(
	[ID],
	[ValueDate],
	[ValueDateInOpics],
	[DealDate],
	[BuyCurrency],
	[SellCurrency],
	[CustomerRate],
	[BuyAmount],
	[SellAmount],
	[InternalRate],
	[Customer],
	[Porfolio],
	[Branch],
	[ImportTransactionID],
	[RunningDate],
	[Status],
	[DealNo]
) 
VALUES 
(
	@ID,
	@ValueDate,
	@ValueDateInOpics,
	@DealDate,
	@BuyCurrency,
	@SellCurrency,
	@CustomerRate,
	@BuyAmount,
	@SellAmount,
	@InternalRate,
	@Customer,
	@Porfolio,
	@Branch,
	@ImportTransactionID,
	@RunningDate,
	@Status,
	@DealNo
)

GO
	
